﻿<script type="text/javascript">
<!--
function add_cart(id_deal){
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
											  window.location.assign("<?php echo base_url("cart");?>");					 
										  }
									  }
	xmlhttp.open("GET","<?php echo base_url("home/add_cart")?>?id_deal="+id_deal,true);
	xmlhttp.send();
	
}
//-->
</script>
<style>

.form_detail img {
    max-width: 710px;
    height: auto !important;
}
.udsp img {
    max-width: 445px;
    max-height: 170px;
}
.dksd img {
    max-width: 235px;
    max-height: 170px;
}
</style>

<div class="product_info">
    <div class="form_buy">
      <div class="view_slide"><img src="<?php echo base_url($deal_detail[0]['small_image']); ?>" width="550" height="500" /></div>
      <div class="form_buy_info">
        <h2><?=$deal_detail[0]['name']?></h2>
        <!-- <p class="company">Spa Việt Hàn (Mã: 34419)</p> -->
        <div class="box_action">
          <p class="box_price"><?=number_format($deal_detail[0]['price_sale_off'])?>đ</p>
          <div class="sale_off">
            <div class="orpri">
              <p>Giá gốc</p>
              <p class="pri-per"><?=number_format($deal_detail[0]['price'])?>đ</p>
            </div>
            <div class="peroff">
              <p>Giảm</p>
              <p class="pri-per"><?=$deal_detail[0]['sale_off']?>%</p>
            </div>
          </div>
          
          <div class="pt_giaohang"><?php if($deal_detail[0]['delivery']==0) echo 'Giao sản phẩm'; if($deal_detail[0]['delivery']==1) echo 'Giao voucher'; ?></div>
          
        </div>
        <a onclick="add_cart(<?=$deal_detail[0]['id']?>)" style="cursor: pointer;" class="buy">Mua</a> </div>
    </div>
    <!-- end forn buy-->
    <div class="form_dk">
      <div class="udsp">
      <h2>Ưu điểm của sản phẩm</h2>
      	<?=$deal_detail[0]['advantage']?>
        
      </div>
      <div class="dksd">
      <h2>Điền kiện sử dụng</h2>
        <?=$deal_detail[0]['condition']?>
      </div>
    </div>
    <!--end forn dk-->
    
    <div class="form_detail">
      <h2>Chi tiết sản phẩm</h2>
      <?=$deal_detail[0]['detail']?>
    </div>
    <!--end form detail --> 
  </div>
  <!-- end product info -->
  
  <div class="right_section">
    <h2>Deal hôm nay</h2>
    <ul>

     <?php foreach ($list_deal_today as $value){	?>
      <li>
         <h3><a href="<?=base_url('deal_detail?did='.$value['id'])?>"><?=$value['name']?></a></h3>
         <a href="<?=base_url('deal_detail?did='.$value['id'])?>">
        <div class="ar_info" style="background: url(<?php echo base_url($value['small_image']); ?>) repeat scroll center center / cover transparent;">
         <span class="sale-off-de">-<?=$value['sale_off']?>%</span>
          <div class="pro_price">
            <p class="prior">Giá gốc: <span ><?=number_format($value['price'])?>đ</span></p>
            <p class="prinow"><?=number_format($value['price_sale_off'])?>đ</p>
          </div>
        </div>
        </a>
      </li>
      <?php }?>
    </ul>
     <p class="xemthem"><a href="<?=base_url('dealtoday')?>">Xem thêm >></a></p> 
  </div>
  <!-- end right section --> 